package com.example.rest.apphandler;

import com.alibaba.fastjson.JSONObject;
import com.example.base.app.AppHandler;
import com.example.base.security.SecurityUtil;
import com.example.base.security.SysUser;
import com.example.base.utils.ResponseUtils;
import com.example.base.utils.Result;
import lombok.extern.slf4j.Slf4j;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Slf4j
public class BaseAppHandler implements AppHandler {

    @Override
    public boolean handlerBefore(HttpServletRequest request, HttpServletResponse response,String appName) {
        log.info("开始进入我了 baseApp");
        SysUser sysUser=SecurityUtil.getSysUserEntity();
        log.info("username: {}",sysUser.getUserName());
        return true;
    }

    @Override
    public void handlerAfter(HttpServletRequest request, HttpServletResponse response) {
        log.info("开始走完了 {}",request.getRequestURI());
    }

    @Override
    public boolean isLogin() {
        return true;
    }

    @Override
    public List<String> noLoginPath() {
        return null;
    }
}
